# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .models import Content
from django.shortcuts import render
from django.core.paginator import Paginator,EmptyPage,PageNotAnInteger

# Create your views here.
def home(request):
    articles = Content.objects.all()
    paginator = Paginator(articles,2)
    page = request.GET.get('page')
    try:
        post_list = paginator.page(page)
    except:
        post_list = paginator.page(1)
    print type(post_list)

    return render(request,'boke.html',{'posts':post_list})